<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<title>搜索</title>
	<link rel="stylesheet" type="text/css" href="__CSS__/api.css" />
	<link rel="stylesheet" type="text/css" href="__CSS__/aui.css" />
	<style>
	body {
		background-color: #F4F4F4;
		outline: 0;
 		padding-top:5px;
	}
    .outer{
      background-color: #fff;
    }
    .good{
      margin-left:0.5rem;
      margin-right:0.5rem;
      padding-top:0.55rem;
      padding-bottom: 0.55rem;
    }
    .avatar {
      width: 4.65rem;
      height:4.65rem;
      margin-right: 0.75rem;
    }
    .avatar img {
      width: 100%;
      height: 100%;
    }
    .name {
		font-size: 14px;
		color: #404040;
	}
    .intro{
      font-size: 12px;
	  color: #999;
      padding-bottom:0.75rem;
    }
    .price{
      font-size: 15px;
	  color: #F04040;
    }
		.jian,
		.jia {
			width: 1rem;
			height: 1rem;
			/*margin-top:0.625rem;*/
		}
		.number {
			padding-left:1.4rem;
			padding-right:1.4rem;
			/*padding-top: 0.6rem;*/
			font-size: 14px;
			color: #666;
		}
	</style>
	<style>
		.aui-iconfont {
			position: relative;
			font-family: "aui_iconfont" !important;
			font-size: 0.7rem;
			font-style: normal;
			-webkit-font-smoothing: antialiased;
			-moz-osx-font-smoothing: grayscale;
			height: 2.4rem;
		}
		.aui-icon-tu {
			height: 2.4rem;
			width: 49px;
			background: url('__IMG__/left.png') no-repeat center center;
			background-size: 10px 17.5px;
		}
		.aui-bar-nav .aui-iconfont1{
			position: relative;
			z-index: 20;
			font-size: 0.9rem;
			color: #ffffff;
			line-height: 2.4rem;
			padding-left: 0.75rem;
		}

		.aui-searchbar {
			display: -webkit-box;
			-webkit-box-pack: center;
			-webkit-box-align: center;
			height: 2.37rem;
			overflow: hidden;
			width: 92%;
			background-color: #ffffff;
			color: #555;
			-webkit-backface-visibility: hidden;
			backface-visibility: hidden;
			margin-left:2.5px;
		}

		.aui-searchbar-input {
			background-color: #F5F7F8;
			border-radius: 1rem;
			height: 27px;
			line-height: 27px;
			font-size: 0.7rem;
			position: relative;
			display: -webkit-box;
			-webkit-box-flex: 1;
		}

		.aaa {
			height: 27px;
			line-height: 27px;
			font-size: 14px;
			color: #999999 !important;
			display: inline-block;
			vertical-align: top;
			margin-top: 1px;
		}

		.aui-icon-search:before {
			content: '';
			width: 12px;
			height: 1.50rem;
			background: url('__IMG__/main1Search.png') no-repeat center center;
			background-size: 12px 13px;
			display: inline-block;
		}
		.aui-bar-nav .aui-title {
			min-height: 2.4rem;
			position: absolute;
			margin: 0;
			text-align: center;
			white-space: nowrap;
			right: 0.75rem;
			left: 1.5rem;
			overflow: hidden;
			text-overflow: ellipsis;
			z-index: 2;
		}
		.pposition{
			min-height: 2.4rem;
			position: absolute;
			margin: 0;
			text-align: center;
			white-space: nowrap;
			left: 0rem;
			width: 12rem;
			overflow: hidden;
			text-overflow: ellipsis;
			z-index: 2;
		}
		.pposition_left{
			float: left;
			width: 0.75rem;
			height: 0.7rem;
			margin-top: 0.85rem;
		}
		.eara{
			float: left;
			color: #4F3E37;
			font-size: 14px;
			margin: 0 0.2rem;
		}
		.pposition_right{
			float: left;
			width: 0.75rem;
			height: 0.7rem;
			margin-top: 0.85rem;
		}

		.aui-icon-rightu{
			height: 2.35rem;
			width: 40px;
			background: url('__IMG__/search.png') no-repeat center center;
			background-size: 18px 18.5px;
		}
		.aui-icon-rightu1{
			height: 2.35rem;
			width: 50px;
			background: url('__IMG__/car.png') no-repeat center center;
			background-size: 18.5px 19px;
		}
		.cha{
			height:  27px;
			width: 17px;
			background: url('__IMG__/search_delete.png') no-repeat center center;
			background-size: 17px 17px;
			position: absolute;
			right:13.5px;
			bottom: 0;
		}
		.num{
			height:  14px;
			min-width: 14px;
			text-align: center;
			line-height: 10px;
			color: #fff;
			font-size: 10px;
			background-color: #F04040;
			border-radius: 10px;
			position: absolute;
			top:7px;
			right:7px;
		}
		.hidden{
			display: none;
		}
	</style>
</head>

<body>
<header class="aui-bar aui-bar-nav underLine" id="header">
	<a class="aui-pull-left" tapmode="active" onclick="window.history.back(-1);"> <span class="aui-iconfont aui-icon-tu"> </span> </a>
	<div class="aui-title">
		<div class="aui-searchbar" id="search">
			<div class="aui-searchbar-input aui-border-radius">
				<div>
					<input class="aaa" type="search" placeholder="输入关键字" style="background-color: #f5f7f8;width: 100%;height: 27px;line-height: 27px;padding-top: 1px;" />
					<div class="cha hidden" tapmode="active" onclick="cha()"></div>
				</div>
			</div>
		</div>
	</div>
	<a class="aui-pull-right" style="position:relative;">
		<!-- 搜索 -->
		<span class="aui-iconfont aui-icon-rightu" id="sou" tapmode="active" onclick="search()"></span>
		<!-- 搜索结果 -->
		<span class="aui-iconfont aui-icon-rightu1 hidden" id="car" tapmode="active" onclick="right()"></span>
		<span class="num  hidden">11</span>
	</a>
</header>
<div id="ajaxGet">
	<div class="seat {if $good}hidden{/if}" id="seatAll">
		<img src="__IMG__/quexing/no_content.png" class="seatImg"/>
		<div class="seatName">没有符合条件的内容</div>
	</div>
	<div id="list">
	{volist name='good' id='g'}
	<div class="outer" onclick="openOneProduct(this)" g_id="{$g.g_id}">
		<div class="good flex-wrap underLine">
			<div class="avatar">
				<img src="{$g.g_thumb ?? '__IMG__/zhanweitu/a3.png'}" class="shop_pic">
			</div>
			<div class="flex-con">
				<div class="name aui-ellipsis-2">{$g.g_name ?? ''}</div>
				<div class="intro aui-ellipsis-1">原价{$g.g_price_before ?? '0'}</div>
				<div class="flex-wrap">
					{if $g.g_prcie_kill !='0' }
					<div class="price flex-con">￥{$g.g_prcie_kill ?? '0'}</div>
					{else /}
					<div class="price flex-con">￥{$g.g_price_now ?? '0'}</div>
					{/if}
					<div class="jian" tapmode onclick="delectOneProductAllPointtt(this)" g_id="{$g.g_id}">
						<img src="__IMG__/jian.png" alt=""/>
					</div>
					<div class="number" id="numberrr_{$g.g_id}">{$g.haveNum}</div>
					<div class="jia" tapmode onclick="addOneProductAllPointtt(this)" g_id="{$g.g_id}">
						<img src="__IMG__/add.png" alt=""/>
					</div>
				</div>
			</div>
		</div>
	</div>
	{/volist}
	</div>
</div>
<input type="hidden" id="s_id" value="{$s_id}" />
</body>
<script type="text/javascript" src="__JS__/jquery.min.js"></script>
<script type="text/javascript" src="__JS__/tt22.js"></script>
<script type="text/javascript">
    var key = $('.aaa').val().trim();
    if (key) {
        search();
    }
    document.onkeydown = function (event) {
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if (e && e.keyCode == 13) { // enter 键
            //你的操作
            search();
        }
    };
    function search() {
        var key = $('.aaa').val().trim();
        var sid = $('#s_id').val();
        if (key == '') {
            alert('搜索内容不能为空');
            return;
        } else {
            $.ajax({
                url: '{:url("home/Index/shopGoodList")}',
                data: 's_id=' + sid + '&keyword=' + key + '&ajax=777',//
                type: 'POST',
                dataType: 'json',
                success: function (data) {
                    $('#list').empty();
                    if (data.msg.length <= 0) {
                        $('#seatAll').removeClass('hidden');
                    } else {
                        $('#seatAll').addClass('hidden');
                        var datas = data.msg;
                        $.each(datas, function (key, v) {
                            if (!v.g_thumb) {
                                v.g_thumb = '__IMG__/zhanweitu/a3.png';
                            }
                            if (!v.g_price_before) {
                                v.g_price_before = 0;
                            }
                            if (v.g_prcie_kill > 0) {
                                v.g_price_now = v.g_prcie_kill;
                            }
                            $("#list").append('' +
                                '<div class="outer" onclick="openOneProduct(this)" g_id="' + v.g_id + '">' +
                                '<div class="good flex-wrap underLine">' +
                                '<div class="avatar"><img src="' + v.g_thumb + '" class="shop_pic">' +
                                '</div><div class="flex-con">' +
                                '<div class="name aui-ellipsis-2">' + v.g_name + '</div>' +
                                '<div class="intro aui-ellipsis-1">原价' + v.g_price_before + '</div>' +
                                '<div class="flex-wrap">' +
                                '<div class="price flex-con">￥' + v.g_price_now + '</div>' +
                                '<div class="jian" tapmode onclick="delectOneProductAllPointtt(this)" g_id="' + v.g_id + '">' +
                                '<img src="__IMG__/jian.png" alt=""/></div>' +
                                '<div class="number" id="numberrr_' + v.g_id + '">' + v.haveNum + '</div>' +
                                '<div class="jia" tapmode onclick="addOneProductAllPointtt(this)" g_id="' + v.g_id + '">' +
                                '<img src="__IMG__/add.png" alt=""/></div></div></div></div></div>'
                            );
                        });
                    }
//                $('#ajaxGet').html(data);
                },
                error: function () {
                    alert('Ajax error!12');
                }
            })
        }
    }
    function openOneProduct(el) {
        var gid = $(el).attr('g_id');
        location.href = '{:url("home/Index/shopGoodInfo")}?g_id=' + gid;
    }
</script>
</html>